set more off
clear
clear matrix
set mem 700m
set more off
version 11

cd "D:\Documents\My Dropbox\Intraparty conflict duration of legislative process\Laws_UK"
use LawDurationUK_HaberR&P2014

* ========================================
* Creating Survival Data
* ========================================

stset duration, failure(failure==0)
stdes

* ===========================================
* Testing the proportional-hazards assumption
* ===========================================

stcox 	varianceGov distance seatsLower timeTillSession timeTillTerm saliencePublic topicBudget if initiateGov==1 & hybridBill!=1
stphtest, detail

* ============================================================================
* Table 1: Cox Model estimations of the duration of bills in the UK Parliament
* ============================================================================
stcox 	varianceGov distance seatsLower timeTillSession timeTillTerm saliencePublic topicBudget if initiateGov==1 & hybridBill!=1, nohr texp(ln(_t)) tvc(topicBudget)
